<template>
  <div class="home">
    <!-- 顶部卡片 -->
    <el-row :gutter="20" class="card-row">
      <el-col :span="4">
        <el-card shadow="hover" class="card purple">
          <div class="card-title">新增客户订单</div>
          <div class="card-number">5</div>
        </el-card>
      </el-col>
      <el-col :span="4">
        <el-card shadow="hover" class="card blue">
          <div class="card-title">新运输计划</div>
          <div class="card-number">6</div>
        </el-card>
      </el-col>
      <el-col :span="4">
        <el-card shadow="hover" class="card red">
          <div class="card-title">新派车单</div>
          <div class="card-number">8</div>
        </el-card>
      </el-col>
      <el-col :span="4">
        <el-card shadow="hover" class="card purple">
          <div class="card-title">新回单</div>
          <div class="card-number">8</div>
        </el-card>
      </el-col>
      <el-col :span="4">
        <el-card shadow="hover" class="card orange">
          <div class="card-title">异常单</div>
          <div class="card-number">1</div>
        </el-card>
      </el-col>
    </el-row>

    <!-- 图表区域 -->
    <el-row :gutter="20" style="margin-top: 20px;">
      <el-col :span="12">
        <el-card>
          <div slot="header">
            <span>派车单跟踪</span>
            <el-button style="float: right; padding: 3px 0" type="text">
              <i class="el-icon-refresh"></i>
            </el-button>
          </div>
          <!-- 这里可以放图表组件 -->
        </el-card>
      </el-col>
      
      <el-col :span="12">
        <el-card>
          <div slot="header">
            <span>延误预警</span>
            <el-button style="float: right; padding: 3px 0" type="text">
              <i class="el-icon-refresh"></i>
            </el-button>
          </div>
          <el-table :data="delayWarningData" style="width: 100%">
            <el-table-column prop="orderNo" label="派车单"></el-table-column>
            <el-table-column prop="carrier" label="承运商"></el-table-column>
            <el-table-column prop="plateNo" label="车辆"></el-table-column>
            <el-table-column prop="status" label="节点"></el-table-column>
            <el-table-column prop="delay" label="延误"></el-table-column>
          </el-table>
        </el-card>
      </el-col>
    </el-row>

    <!-- 底部图表 -->
    <el-row :gutter="20" style="margin-top: 20px;">
      <el-col :span="8">
        <el-card>
          <div slot="header">
            <span>业务达成情况</span>
            <el-button style="float: right; padding: 3px 0" type="text">
              <i class="el-icon-refresh"></i>
            </el-button>
          </div>
          <!-- 这里放业务达成图表 -->
        </el-card>
      </el-col>
      
      <el-col :span="8">
        <el-card>
          <div slot="header">
            <span>应收账务</span>
            <el-button style="float: right; padding: 3px 0" type="text">
              <i class="el-icon-refresh"></i>
            </el-button>
          </div>
          <!-- 这里放应收账务图表 -->
        </el-card>
      </el-col>
      
      <el-col :span="8">
        <el-card>
          <div slot="header">
            <span>应付账务</span>
            <el-button style="float: right; padding: 3px 0" type="text">
              <i class="el-icon-refresh"></i>
            </el-button>
          </div>
          <!-- 这里放应付账务图表 -->
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'Home',
  data() {
    return {
      delayWarningData: [
        {
          orderNo: '878781',
          carrier: '佳吉物流',
          plateNo: '黑A 89898',
          status: '已发车',
          delay: '0.5天'
        },
        // 更多数据...
      ]
    }
  }, methods: {
    
  }
}
</script>

<style scoped>
.home {
  padding: 20px;
}

.card-row {
  margin-bottom: 20px;
}

.card {
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
}

.card.purple {
  background: #975fe4;
}

.card.blue {
  background: #409EFF;
}

.card.red {
  background: #F56C6C;
}

.card.orange {
  background: #E6A23C;
}

.card-title {
  font-size: 14px;
  margin-bottom: 10px;
}

.card-number {
  font-size: 24px;
  font-weight: bold;
}

.el-card {
  margin-bottom: 20px;
}
</style>
